<template>
  <div class="provide_container">
    <inJect></inJect>
    <button @click="changeAge">+age</button>
  </div>
</template>
<script>
import { provide, ref, readonly } from 'vue'
import inJect from './inject.vue'
export default {
  components: {
    inJect
  },
  setup () {
    const name = ref('why')
    const age = ref(20)
    provide('name', readonly(name))
    provide('age', readonly(age))
    const changeAge = () => age.value++
    return {
      name,
      age,
      changeAge
    }
  }
}
</script>
<style scoped>
</style>
